#include <stdio.h>
#include <stdlib.h>

int main (int argc, char const* argv[])
{
    int a, b, n, ca, cb, i, bnow;

    while (scanf("%d %d %d", &ca, &cb, &n) != EOF) {
        b = 0;
        while (b != n) {
            for (i = 0; i <= (cb-b)/ca; i++) {
                printf("fill A\n");
                printf("pour A B\n");
                bnow = b + ca * (i + 1);
                
                if (bnow == n) break;
            }
            if (bnow == n) break;
            printf("empty B\n");

            a = ca - (cb - b) % ca;
            printf("pour A B\n");
            b = a;
            if (b == n) break;
        }
        printf("success\n");
    }

    return 0;
}
